/*    */ package system.staros.sblock1;
/*    */ 
/*    */ import java.util.LinkedList;
/*    */ 
/*    */ public class TokenBuffer
/*    */ {
/*    */   private LinkedList<Token> tokenQueue;
/*    */   private Lexer lexer;
/*    */ 
/*    */   public TokenBuffer(Lexer paramLexer, int paramInt)
/*    */   {
/* 37 */     this.lexer = paramLexer;
/* 38 */     this.tokenQueue = new LinkedList();
/*    */ 
/* 41 */     for (int i = 0; i < paramInt; i++) {
/* 42 */       Token localToken = nextToken();
/* 43 */       if (localToken == null) {
/*    */         break;
/*    */       }
/* 46 */       this.tokenQueue.addLast(localToken);
/*    */     }
/*    */   }
/*    */ 
/*    */   private Token nextToken() {
/* 51 */     Token localToken = this.lexer.getNextToken();
/* 52 */     while ((localToken != null) && (localToken.getType() == TokenType.COMMENT)) {
/* 53 */       localToken = this.lexer.getNextToken();
/*    */     }
/* 55 */     return localToken;
/*    */   }
/*    */ 
/*    */   public boolean isEmpty() {
/* 59 */     return this.tokenQueue.isEmpty();
/*    */   }
/*    */ 
/*    */   public int size() {
/* 63 */     return this.tokenQueue.size();
/*    */   }
/*    */ 
/*    */   public Token getToken(int paramInt) {
/* 67 */     return (Token)this.tokenQueue.get(paramInt);
/*    */   }
/*    */ 
/*    */   public Token readToken()
/*    */   {
/* 74 */     if (this.tokenQueue.isEmpty()) {
/* 75 */       return null;
/*    */     }
/* 77 */     Token localToken1 = (Token)this.tokenQueue.removeFirst();
/*    */ 
/* 80 */     Token localToken2 = nextToken();
/* 81 */     if (localToken2 != null) {
/* 82 */       this.tokenQueue.addLast(localToken2);
/*    */     }
/* 84 */     return localToken1;
/*    */   }
/*    */ }

/* Location:           D:\Марк\!IMPORTANT\staros\archive\version-2.260.zip
 * Qualified Name:     system.staros.sblock1.TokenBuffer
 * JD-Core Version:    0.6.1
 */